package com.h.order.controller;

import com.h.order.model.OrderInfo;
import com.h.order.service.IOrderService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/order")
@RestController
public class OrderController {

    @Resource(name = "orderServiceImpl")
    private IOrderService orderService;

    @RequestMapping("/{orderId}")
//    @PathVariable 这个注解是从URL 中拿取参数orderId 注入到 参数中的orderId中
    private OrderInfo getOrderInfo(@PathVariable("orderId") Integer orderId) {
        return orderService.selectById(orderId);
    }
}
